package day1025_1;

public class E1 {
    public static void main(String[] args) {
        try {
            new E1().test();//ctrl  alt  t
        } catch (NullPointerException e) {
            e.printStackTrace();
        } finally {
            System.out.println("try-catch-finally代码块最后执行的部分");
        }
    }
    public  void test()throws  NullPointerException{
        String name=null;
        System.out.println( name.length() );
        //name为null打印不了长度(会出现NullPointerException)
    }
}
